# Set the minimum version of CMake that can be used
# To find the cmake version run
# $ cmake --version
cmake_minimum_required(VERSION 3.5)

# Set the project name
project (rtmp)

file(GLOB_RECURSE sourceFiles "${PROJECT_SOURCE_DIR}/librtmp/*.c" "${PROJECT_SOURCE_DIR}/librtmp/*.h")

# Add an executable
add_library(rtmp STATIC ${sourceFiles})


install(TARGETS rtmp
LIBRARY DESTINATION lib  # 动态库安装路径
ARCHIVE DESTINATION lib  # 静态库安装路径
RUNTIME DESTINATION bin  # 可执行文件安装路径
PUBLIC_HEADER DESTINATION include  # 头文件安装路径
)

install(FILES 
${PROJECT_SOURCE_DIR}/librtmp/rtmp.h
${PROJECT_SOURCE_DIR}/librtmp/amf.h
${PROJECT_SOURCE_DIR}/librtmp/http.h
${PROJECT_SOURCE_DIR}/librtmp/log.h
 DESTINATION include/librtmp)